Repository navigation
feat!: convert to a node24 JavaScript action - #322
Conversation
|
Thanks for this, @minijus! We'd like to try this approach before committing to it, so here's the plan:
Before we merge, could you:
Once that's done, I'll approve the CI run so the full OS matrix runs. Thank you! |
Replace the Docker container action (Dockerfile + entrypoint.sh) with a TypeScript action running on node24, bundled into dist/index.js. - Install the native Crowdin CLI binary for the runner platform from the @crowdin/cli-<platform> npm packages, verify its integrity and cache it with @actions/tool-cache. New inputs: cli_version, use_installed_cli, npm_registry_url. - Port entrypoint.sh to TypeScript using @actions/core, @actions/exec and Octokit (pull request, labels, assignees, reviewers). - Keep all existing inputs and outputs. The `user` input is deprecated and has no effect, as files are now created by the runner user. - Pass the git identity and signing key per command and import the GPG key into a temporary GNUPGHOME instead of modifying global configuration. Works on Linux, macOS and Windows runners (x64/arm64) without Docker. Closes crowdin#321 Refs crowdin#160, crowdin#284 BREAKING CHANGE: the action now runs on the runner host instead of a Docker container, requires git on the runner (and gpg when signing), and the pull_request_url output no longer includes surrounding quotes. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
9c6f371 to
5589379
Compare
|
@andrii-bodnar Done. I rebased the PR onto Validation passed locally under Node 24: type-check, all 42 tests, and the bundle build. The updated GitHub test workflow is awaiting approval. 🤖 Generated by GPT-6 Luna (gpt-6-luna) |
Closes #321. Also addresses #160 (non-Linux/arm64 runners) and #284 (root-owned files).
This replaces the Docker container action (
Dockerfile+entrypoint.sh) with a TypeScript action that runs onnode24. The bundled output is indist/index.js. All existing inputs and outputs are kept, so it can be released as a drop-inv4.Changes
@crowdin/cli-<platform>npm package. It checks the download against the registry'ssha512integrity hash and caches it with@actions/tool-cache. glibc and musl Linux builds are cached separately. Three new optional inputs:cli_version: defaults to5.5.0, the same version the old Dockerfile used. Exact versions and dist-tags such aslatestare accepted.use_installed_cli: use acrowdinalready onPATHinstead of downloading.npm_registry_url: download from an npm mirror instead of the public registry.entrypoint.sh: the shell script is rewritten in TypeScript using@actions/coreand@actions/exec. Pull requests, labels, assignees and reviewers now go through Octokit instead of curl and jq. Branch handling, restoring the original checkout and GPG signing behave as before.git -c. The GPG key is imported into a temporaryGNUPGHOME, which is deleted afterwards. This matters on self-hosted runners, where the old global git config changes would persist.userinput: deprecated and has no effect, because files are now created by the runner user.dist/is up to date. The action itself is run onubuntu-latest,ubuntu-24.04-arm,macos-latest,macos-15-intelandwindows-latest.v4is added toupdate-main-version.yml.CONTRIBUTING.mdhas development instructions.Behavior changes (why this is a breaking release)
gitmust be available on the runner, andgpgonly whengpg_private_keyis set.command,command_argsand*_argsare split the way a shell would, so--label "a b"is passed as one argument. Before, the quotes were passed through literally.pull_request_urlno longer has surrounding double quotes. This was a bug in the old script.Testing
npm run typecheck,npm test(37 tests) andnpm run buildpass locally.dist/index.jslocally on macOS arm64. Downloading, verifying and caching the CLI, reusing the cached copy,cli_version: latest,use_installed_cliand thecommand_outputoutput all worked.Notes for maintainers
@v3references in the README and docs unchanged; switching them to@v4is a release decision.dist/is committed and marked aslinguist-generated.🤖 Generated by Claude Opus 5.5 (claude-opus-5.5)